﻿using System;
using System.Collections.Generic;

using Fuse8.DomainFramework.Domain;

namespace Fuse8.DomainFramework.CacheService
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [Serializable]
    public class EntityCacheItem<T> where T : class, IEntityObject
    {
        /// <summary>
        /// 
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public IList<T> Entity { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public IList<EntityCacheItemDependency> Dependency { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public EntityCacheItem()
        { }
    }

    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class EntityCacheItemDependency
    {
        /// <summary>
        /// 
        /// </summary>
        public string Tag { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public long TagVersion { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        public EntityCacheItemDependency()
        { }
    }
}
